Global Index
HTML5 JS API Index > File API Tutorials & Specs

Blob

Extended by File

This interface represents immutable raw data. It provides a method to slice data objects between ranges of bytes into further chunks of raw data. It also provides an attribute representing the size of the chunk of data. The File interface inherits from this interface.

Properties
unsigned long long
size
Returns the size of the Blob object in bytes. On getting, conforming user agents must return the total number of bytes that can be read by a FileReader or FileReaderSync object, or 0 if the Blob has no bytes to be read. If the Blob has been neutered with close called on it, then size must return 0.
DOMString
type
The ASCII-encoded string in lower case representing the media type of the Blob. For File objects that are returned from the underlying file system, user agents must return the type of a Blob as an ASCII-encoded string in lower case, such that when it is converted to a corresponding byte sequence, it is a parsable MIME type [MIMESNIFF], or the empty string -- 0 bytes -- if the type cannot be determined.
Constructor
Blob()
Blob(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options)
Operations
void
close()
Calling the close method must permanently neuter the original Blob object. This is an irreversible and non-idempotent operation; once a Blob has been neutered, it cannot be used again; dereferencing a Blob URL bound to a Blob object on which close has been called results in a network error.
Blob
slice(optional long long start, optional long long end, optional DOMString contentType)
The slice method returns a new Blob object with bytes ranging from the optional start parameter upto but not including the optional end parameter, and with a type attribute that is the value of the optional contentType parameter.
Referenced by
FileFile(...)
FileReaderreadAsText(...)
FileReaderSyncreadAsText(...)
ImageBitmapFactoriescreateImageBitmap(...)
URLcreateObjectURL(...)